package com.drpclub.gamebackend.dao;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.UpdateTimestamp;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import java.sql.Timestamp;

/**
 * @author ：drp
 * @Descrpition 文章内容基础信息
 * @date ：Created in 2020/5/8 17:58
 */
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Data
@Entity
@Table(name = "resources")
public class ResourceDao {
    @Id
    @GenericGenerator(name = "id", strategy = "uuid")
    @GeneratedValue(generator = "id")
    private String id;
    private String title;
    private String username;
    @Column(name = "collection_name")
    private String collectionName; //文集名
    private String url;// 静态化页面的位置
    @Column(name = "img_url")
    private String imgUrl;// 封面图片位置
    private String type;// 类型
    private long heat;// 浏览热度
    private long favorites;//收藏人数
    private long download;//下载人数
    @Column(name = "is_value")
    private int isValue = 1;
    @Column(name = "is_publish")
    private int isPublish;
    @Column(name = "create_time")
    @CreationTimestamp
    private Timestamp createTime;
    @Column(name = "update_time")
    @UpdateTimestamp
    private Timestamp updateTime;
}
